package com.app.miwawa.api.system.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.framework.common.api.entity.CommonEntityUUID;
import org.framework.common.api.support.annotation.Tree;
import org.framework.common.api.support.annotation.TreeType;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 系统管理－角色分组
 * <p>描述: </p>
 * <p>Company: Professional</p>
 * @author chanlong(陈龙)
 * @date 2016年3月23日 下午2:13:25
 * @version 1.0.2016
 */
@Entity @Table(name = "TB_SYSTEM_GROUPS")
public class Groups extends CommonEntityUUID {

	/** serialVersionUID(long):. */
	private static final long serialVersionUID = -7682114418536459181L;

	// 角色名称
	@Column(name = "name", length = 50, nullable = true)
	private String name;
	
	// 角色编码
	@Column(name = "code", length = 50, nullable = true)
	private String code;
	
	// 排序号
	@Column(name = "sort", nullable = true)
	private Integer sort;
	
	// 系统ID
	@Column(name = "system_id", length = 50, nullable = true)
	private String systemid;
		
	// 创建时间
	@Temporal(TemporalType.DATE)
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@Column(name = "create_date", nullable = true)
	private Date createDate;
	
	@Override
	@Tree(type = TreeType.ID)
	public String getId() {
		// TODO Auto-generated method stub
		return super.getId();
	}
	
	@Tree(type = TreeType.TEXT)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Tree(type = TreeType.CODE)
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	@Tree(type = TreeType.KEY)
	public String getSystemid() {
		return systemid;
	}

	public void setSystemid(String systemid) {
		this.systemid = systemid;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
}
